#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from tortoise import fields

from app.base.base_model import (
    BaseModel, BaseCreatedUpdatedModel
)

class Role(BaseModel, BaseCreatedUpdatedModel):
    name = fields.CharField(max_length=30, unique=True, description="角色名称")
    remark = fields.CharField(max_length=255, null=True, blank=True, description="角色描述")
    menus = fields.ManyToManyField("models.Menu", related_name="role_menu")
    apis = fields.ManyToManyField("models.Api", related_name="role_api")

    class Meta:
        table = "role"